package com.test.group6.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.test.group6.domain.EnterpriseInformation;
/**
 *@author guo_wei 
 *@version 1.0 
 */
@Mapper
public interface SearchEnterpriseMapper {
	/**
	 *@param enterpriseId 企业编号
	 *@param enterpriseName 企业名称
	 *@param cardType 证件类型
	 *@param cardId 证件号
	 *@return List<EnterpriseInformation> 满足条件的企业信息集合
	 */
	@Select({ "<script>" + "select enterprise_id enterpriseId," + "enterprise_name enterpriseName,"
			+ "card_type cardType," + "card_id cardId," + "enterprise_date enterpriseDate," + "register_date registerDate,"
			+ "update_date updateDate" + "capital,address,workes " + "from enterprise_information " + "<where>"
			+ "<if test='enterpriseId!=null'>and enterprise_id like '%${enterpriseId}%'</if> "
			+ "<if test='enterpriseName!=null'>and enterprise_name like '%${enterpriseName}%'</if> "
			+ "<if test='cardType!=null'>and card_type like '%${cardType}%'</if> "
			+ "<if test='cardId!=null'>and card_id like '%${cardId}%'</if> " + "</where>" + "</script>" })
	List<EnterpriseInformation> getSearchEnterprise(String enterpriseId, String enterpriseName, String cardType,
			String cardId);
}
